import request from '@/utils/request'


/**盘点记录列表  */
export function skuCheckRecordList(params) {
  return request({
    url: `/distribution/stockCheckPosition/skuCheckRecordList`,
    params
  })
}

/**修改备注  */
export function updateStockCheckRemark(checkId, remark) {
  return request({
    url: `/distribution/stockCheck/updateStockCheckRemark/${checkId}/${remark}`,
    // method: 'post'
  })
}

/**清空盘点 / 删除盘点   */
export function clearStockCheck(checkId, positionId = '') {
  return request({
    url: `/distribution/stockCheck/clearStockCheck/${checkId}/${positionId ? positionId : '-1'}`,
  })
}

/**盘点追加库位 */
export function appendPositionNo(checkId, positionId) {
  return request({
    url: `/distribution/stockCheck/appendPositionNo/${checkId}/${positionId}`,
    method: 'post'
  })
}
/**获取盘点详情 */
export function getStockCheckDetailsXml(params) {
  return request({
    url: `/distribution/stockCheck/getStockCheckDetailsXml`,
    params
  })
}

/**盘点审核 */
export function verify(data) {
  return request({
    url: `/distribution/stockCheck/verify`,
    method: 'POST',
    data
  })
}


/**盘点取消 */
export function _cancel(data) {
  return request({
    url: `/distribution/stockCheck/cancel`,
    method: 'POST',
    data
  })
}



/**获取盘点盈亏详情 */
export function getStockCheckProfitLoss(params) {
  return request({
    url: `/distribution/stockCheck/getStockCheckProfitLoss`,
    params
  })
}

/**获取盘点盈亏详情信息数据 */
export function getStockCheckProfitLossInfo(checkId) {
  return request({
    url: `/distribution/stockCheck/getStockCheckProfitLossInfo/${checkId}`,
  })
}


/**获取所有库位 */
export function getStockPositionList(params) {
  return request({
    url: `/distribution/stockCheck/getStockPositionList`,
    params
  })
}

/**手动选择盘点 */
export function createStockCheckByManualOperation(stockPositionIdList, type) {
  return request({
    url: `/distribution/stockCheck/createStockCheckByManualOperation/${stockPositionIdList}/${type}`,
    method: 'post',
    headers: {
      loading: true,
    }
  })
}


/**创建盘点单-全部库位 */
export function createStockCheckAllPosition(type) {
  return request({
    url: `/distribution/stockCheck/createStockCheckAllPosition/${type}`,
    method: 'post',
    headers: {
      loading: true
    }
  })
}

/**查询库存盘点列表 */
export function stockCheckList(query) {
  return request({
    url: '/distribution/stockCheck/list',
    params: query,
  })
}
/***********************/

/**查询盘点库位序列列表 */
export function stockCheckPositionSerialList(query) {
  return request({
    url: '/distribution/stockCheckPositionSerial/list',
    params: query
  })
}

/**扫码接口 */
export function scanSerial(data) {
  return request({
    url: '/distribution/stockCheckPositionSerial/scanSerial',
    method: 'post',
    data
  })
}

/**手动+扫码：信息页面接口 */
export function stockCheckPositionSerial(query) {
  return request({
    url: '/distribution/stockCheckPositionSerial/getInfo',
    params: query
  })
}

/**手动+扫码：确认数量 */
export function confirmNum(data) {
  return request({
    url: '/distribution/stockCheckPositionSerial/confirmNum',
    method: 'post',
    data
  })
}

